//注意 考虑到app端兼容 这里引用组件跟进到 具体文件名
import btn from "../../components/btn/index.vue";
import Vue from "vue";
//装饰器
import { Component } from "vue-property-decorator";
@Component({
	components: {
		btn
	}
})

export class App extends Vue {

	public text1: string = "text1";

	public text2: string = "初始化用户：text2";

	private login: UserLogin;

	constructor(){
		super();
		this.login = new UserLogin();
	}

	public onLoad() {
		wx.showLoading();
	}

	public handleLogin(name: string): void {
		let info = this.login.loginService(`${name}`);
		this.text2 = `欢迎登录：${info.name}`;
	}
}

export class UserLogin {

	private user: UserLoginInfo;

	constructor() {
		this.user = { name: '郭波', age: 35, address: '' };
	}

	public loginService(params: string): UserLoginInfo {
		console.log(`login:${this.user.name}, ${params}`);
		return this.user;
	}

}